#ifndef CHARACTEREDITFORM_H
#define CHARACTEREDITFORM_H



#include "EditFormWrapper.h"



#include <CharacterItem.h>
#include <CampaignItem.h>



namespace Ui {
    class CharacterEditForm;
}


class CharacterEditFormBase : public QWidget, public AbstractEditFormActions
{
    Q_OBJECT

public:

    virtual void updateData();


protected:

    CharacterEditFormBase(QWidget *parent = 0);
    ~CharacterEditFormBase();

    virtual QString message() const;
    CharacterItem* character() const;

    virtual D20BaseModel* model() const
    {
        return m_characterModel;
    }

protected slots:

    virtual void initialize();
    void openCampaign(const QString& campaign_file);
    void validate();

    void onUpdateCampaigns();

private:

    Ui::CharacterEditForm *ui;

    D20BaseModel* m_characterModel;
    ItemModel* m_campaignModel;


private slots:

    void on_actionOpen_Campaign_triggered();
    void on_actionAdd_Reference_triggered();
    void on_actionDelete_triggered();
    void on_actionAdd_Item_triggered();
    void on_actionAdd_Group_triggered();
    void on_actionChange_View_triggered();

    void on_lineEditName_editingFinished();
    void on_comboBoxCampaign_currentIndexChanged(int index);

    void on_pushButtonDescription_clicked();
    void on_pushButtonAbilities_clicked();



};



typedef EditFormWrapper<CharacterEditFormBase> CharacterEditForm;



#endif // CHARACTEREDITFORM_H
